package com.atguigu.gulimall.gulimallauthserver.feign.fallback;

import com.atguigu.common.exception.BizCodeEnume;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.gulimallauthserver.feign.ThirdPartFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 第三方远程服务错误熔断
 *
 * @author xiaoping
 * @create 2020/7/13 18:59
 * @since 1.0.0
 */
@Slf4j
@Component
public class ThirdPartFeignServiceFallBack implements ThirdPartFeignService {
    /**
     * 获取短信验证码
     *
     * @param phone
     * @param code
     * @return
     */
    @Override
    public R sendCode(String phone, String code) {
        log.error("熔断方法调用...sendCode");
        return R.error(BizCodeEnume.TOO_MANY_REQUEST.getCode(), BizCodeEnume.TOO_MANY_REQUEST.getMsg());
    }
}
